package inabit.inabitcompiler.productions.values;

import inabit.compiler.parser.grammar.NonTerminal;
import inabit.compiler.parser.grammar.Production;
import inabit.compiler.parser.grammar.Symbol;
import inabit.compiler.parser.grammar.Terminal;
import inabit.inabitcompiler.lexical.InabitTokenClass;
import inabit.inabitcompiler.parser.InabitSemanticAction;

/**N -> real_cte*/
/**@author Rafael Rocha*/
public class N_Rule2 extends Production{
	private Terminal real_cte;
	
	public N_Rule2() {
		super("N");
	}

	@Override
	protected Symbol[] production(final NonTerminal nonTerminal) {
		real_cte = new Terminal(InabitTokenClass.REAL_CTE);
		Symbol[] symbols = {
				real_cte,
				new InabitSemanticAction(nonTerminal) {
					
					@Override
					public void execute() throws Exception {
						nonTerminal.code = real_cte.getValue();
					}
				}
		};
		return symbols;
	}
}
